/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package gate.learning;

import org.supercsv.cellprocessor.CellProcessorAdaptor;
import org.supercsv.cellprocessor.ift.CellProcessor;
import org.supercsv.util.CSVContext;

/**
 *
 * @author asatrya
 */
public class WekaSanitizer extends CellProcessorAdaptor {

    public WekaSanitizer() {
        super();
    }

    public WekaSanitizer(final CellProcessor cp) {
        super(cp);
    }

    @Override
    public Object execute(Object value, CSVContext context) {
        String result = value.toString();
        result = result.replaceAll("'", "");
        result = result.replaceAll("\"", "");
        result = result.replaceAll("%", "percentage");
        return next.execute(result, context);
    }

}
